﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Presentation.Module.Setup.Interfaces;
using Presentation.Module.Setup.Interfaces.Views;
using Presentation.Module.Setup.Interfaces.ViewModels;

namespace Presentation.Setup.Views
{
    /// <summary>
    /// Interaction logic for TaskCategoriesView.xaml
    /// </summary>
    public partial class TaskCategoriesView : UserControl, ITaskCategoriesView
    {
        // Inject an instance of ITaskCategoriesViewModel
        public TaskCategoriesView(ITaskCategoriesViewModel viewModel)
        {
            InitializeComponent();

            // Set the viewmodel instance to the datacontext of this control so that the view model properties are 
            // available for databinding.
            this.DataContext = viewModel;
            viewModel.View = this;
        }

        public event Shell.Interfaces.ViewExit ViewExit;

        private void Back_Clicked(object sender, RoutedEventArgs e)
        {
            if (this.ViewExit != null)
            {
                this.ViewExit.Invoke();
            }
        }
    }
}
